#!/bin/sh

OUT1=$TMPDIR/out1
OUT2=$TMPDIR/out2
OUT3=$TMPDIR/out3
XDELTA=./xdelta

while test $# -gt 1; do

  FROM=$1
  TO=$2

  shift

  if test -d $FROM -o -d $TO; then
    BOGUS=what
  else
    echo testing $FROM $TO ...
    $XDELTA delta -q0 $FROM $TO $OUT1
    $XDELTA patch $OUT1 $FROM $OUT2
    cmp $OUT2 $TO

    echo testing $TO $FROM ...
    $XDELTA delta -q0 $TO $FROM $OUT1
    $XDELTA patch $OUT1 $TO $OUT2
    cmp $OUT2 $FROM

    echo testing $TO $TO ...
    $XDELTA delta -q0 $TO $TO $OUT1
    $XDELTA patch $OUT1 $TO $OUT2
    cmp $OUT2 $TO

    echo testing $FROM $TO ...
    $XDELTA delta -q6 $FROM $TO $OUT1
    $XDELTA patch $OUT1 $FROM $OUT2
    cmp $OUT2 $TO

    echo testing $TO $FROM ...
    $XDELTA delta -q6 $TO $FROM $OUT1
    $XDELTA patch $OUT1 $TO $OUT2
    cmp $OUT2 $FROM

    echo testing $TO $TO ...
    $XDELTA delta -q6 $TO $TO $OUT1
    $XDELTA patch $OUT1 $TO $OUT2
    cmp $OUT2 $TO
    fi
done;
